//
//  GaoActivityToastView.m
//  DuTe
//
//  Created by Gikki Ares on 2021/1/4.
//

#import "JsActivityReminderView.h"
#import "JsGeometryManager.h"

@interface JsActivityReminderView()

{
	UIActivityIndicatorView * mIndicator;
}

@end

@implementation JsActivityReminderView

+ (JsActivityReminderView *)defalutView {
	JsActivityReminderView * view = [[JsActivityReminderView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)];
	
	UIActivityIndicatorView * indicator = nil;
//这里不要让编译器报警告.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
	if (@available(iOS 13.0, *)) {
		indicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
	}
	else {
			// Fallback on earlier versions
		indicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
	}
#pragma clang diagnostic pop
	[indicator startAnimating];
	indicator.color = [UIColor whiteColor];
	indicator.frame = view.bounds;
	[view addSubview:indicator];
	view.backgroundColor = [UIColor colorWithWhite:0.1 alpha:1];
	view.layer.cornerRadius = 5;
	view.layer.masksToBounds = YES;
	return view;
}


- (void)setupUiWithContainerSize:(CGSize)size {
	
}

//当屏幕旋转时,需要调整位置.
- (void)layoutSubviews {
	[super layoutSubviews];
	self.frame = [JsGeometryManager frameAlignCenterWithContainerSize:self.superview.bounds.size size:self.frame.size];
}

@end
